﻿using System;
using System.Collections.Generic;
using System.Data.Services;
using System.Linq;
using System.ServiceModel.Web;
using System.Web;
using BLL;
using ADONETDataServicesExtension.BLLUtils;
using ADONETDataServicesExtension;
using System.ServiceModel;

namespace ADONETDataServices
{
    [ServiceBehavior(IncludeExceptionDetailInFaults = true)]
    public class WebDataService : ADONETDataServicesExtension.DataService<Context>, IEFEntitiesEncapsulatedDataService
    {
        public static void InitializeService(IDataServiceConfiguration config)
        {
            config.UseVerboseErrors = true;

            config.SetEntitySetAccessRule("*", EntitySetRights.All);
        }

        IEFEntitiesEncapsulatedContext IEFEntitiesEncapsulatedDataService.CurrentDataSource
        {
            get { return CurrentDataSource; }
        }
    }
}
